import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:get/get.dart';

import 'index_page.dart';

/// 创建人： Created by zhaolong
/// 创建时间：Created by  on 2020/7/25.
///
/// 创建人： Created by zhaolong
/// 创建时间：Created by  on 2020/9/25.
///
/// gongzhonghao biglead
/// github https://github.com/zhaolongs
/// bili https://space.bilibili.com/513480210
/// zhihu https://www.zhihu.com/people/zhao-long-90-89
/// csdn https://blog.csdn.net/zl18603543572
/// 西瓜视频 https://www.ixigua.com/home/3662978423
/// 代码清单12-2
/// lib/app/app_root_page.dart
class AppRootPage extends StatelessWidget{
  const AppRootPage({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      //应用的主题
      theme: ThemeData(
        //主背景色
        primaryColor: Colors.blue,
        //Scaffold脚手架的背景色
        scaffoldBackgroundColor: Color(0xffeeeeee),
      ),
      //应用程序默认显示的页面
      home: const IndexPage(),
      //dubug模式下不显示debug标签
      debugShowCheckedModeBanner: false,
      //国际化语言环境
      localizationsDelegates: const [
        //初始化默认的 Material 组件本地化
        GlobalMaterialLocalizations.delegate,
        //初始化默认的 通用 Widget 组件本地化
        GlobalWidgetsLocalizations.delegate,
        //支持使用 CupertinoAlertDialog 的代理
        GlobalCupertinoLocalizations.delegate,
      ],
      //配置程序语言环境
      locale: const Locale('zh', 'CN'),
    );
  }
}
